﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using MMITCore;
using MMITDomain;
using MMITDomain.Concrete;
using MMITDomain.Entities;


namespace MMITCore
{
    [ServiceContract]
    public interface ICoreServiceREST
    {
        [OperationContract (Name="LoadMoneyREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "LoadMoney?SerialNo={SerialNo}&PIN={PIN}&UserId={UserId}")]
        ResponseObject LoadMoney(string SerialNo, string PIN, int UserId);

       [OperationContract(Name = "LoadMoneyExternalREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "LoadMoneyExternal?UkashVoucherNumber={UkashVoucherNumber}&UserId={UserId}&Amount={Amount}&Currency={Currency}")]
        ResponseObject LoadMoneyExternal(string UkashVoucherNumber, int UserId, decimal Amount, string Currency);

        [OperationContract(Name = "SendMoneyREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
        UriTemplate = "SendMoney?SerialNo={SerialNo}&PIN={PIN}&SenderId={SenderId}&RecipientId={RecipientId}&RecipientMSISDN={RecipientMSISDN}&Amount={Amount}&FirstName={FirstName}&LastName={LastName}&IdenticationTypeId={IdenticationTypeId}&IdentificationNumber={IdentificationNumber}&CountryId={CountryId}&SendMoneyRecipientType={SendMoneyRecipientType}&PartnerId={PartnerId}")]
        ResponseObject SendMoney(string SerialNo, string PIN, int SenderId, int RecipientId, string RecipientMSISDN, decimal Amount, string FirstName, string LastName, int IdenticationTypeId, string IdentificationNumber, int CountryId, int SendMoneyRecipientType, int PartnerId);

        //[OperationContract]
        //ResponseObject SendMoneyExternal(int SenderId, string RecipientMSISDN, decimal Amount, string FirstName, string LastName, int IdenticationTypeId, string IdentificationNumber, int recipientCountryId, string Address, int SendMoneyRecipientType);

        [OperationContract(Name = "WithdrawMoneyREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "WithdrawMoney?token={token}&amount={amount}&RecipientMSISDN={RecipientMSISDN}&AuthorisationId={AuthorisationId}")]
        ResponseObject WithdrawMoney(string token, decimal amount, string RecipientMSISDN, int AuthorisationId);

        [OperationContract(Name = "RequestTokenREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "RequestToken?amount={amount}&MSISDN={MSISDN}")]
        ResponseObject RequestToken(decimal amount, string MSISDN);

        [OperationContract(Name = "RedeemVoucherREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "RedeemVoucher?SerialNo={SerialNo}&PIN={PIN}&Username={Username}&Password={Password}&TransactionCode={TransactionCode}&VoucherType={VoucherType}&Amount={Amount}&PurchaseValue={PurchaseValue}&Currency={Currency}&MobileNo={MobileNo}")]
        [ServiceKnownType(typeof(RedeemVoucher))]
        RedeemVoucher RedeemVoucher(string SerialNo, string PIN, string Username, string Password, string TransactionCode, int VoucherType, decimal Amount, decimal PurchaseValue, string Currency, string MobileNo);

        [OperationContract(Name = "QueryTransactionREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "QueryTransaction?token={token}")]
        [ServiceKnownType(typeof(QueryTransaction))]
        QueryTransaction QueryTransaction(string token);

        [OperationContract(Name = "GetTransactionChargesREST")]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetTransactionCharges?txnAmount={txnAmount}&transactionType={transactionType}")]
        [ServiceKnownType(typeof(TransactionCharges))]
        TransactionCharges GetTransactionCharges(decimal txnAmount, int transactionType);
    }
}
